import os

os.sys.path.append(os.getcwd())

from utils import *

if __name__ == '__main__':
    excel_path = "./data/吾优.xlsx"
    checkpoint_path = "./data"
    config_path = "./threshold.conf"
    stop_path = "./data/stopwords.txt"
    df= excel2csv(excel_path)
    stopwords = get_stopwords(stop_path)
    df = title2corpus(df, stopwords)
    rules = parse_config(config_path)
    df_filter = rule_filter(df, rules)
    model_filter = get_model(df_filter)
    vocab2count = extract_keywords(model_filter, df_filter, "./result")
    word2vec_model = get_word2vec(df)
    vocab2count = get_vocab2vec(vocab2count, word2vec_model)
    df.to_csv("{}/checkpoint.csv".format(checkpoint_path), index= False, header= True)
    df_filter.to_csv("{}/filter_checkpoint.csv".format(checkpoint_path), index= False, header= True)
